// 导入类型声明文件
import type { BannerItem, categoryPaanelItem, HotPanelItem, GuessItem } from '@/types/home'
import type { PageResult, PagePargram } from '@/types/global'
// 导入http网络请求
import { http } from '@/utils/http'



// 获取首页轮播图
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    url: '/home/banner',
    method: "GET",
    data: {
      distributionSite
    }
  })
}



// 获取前台分类数据
export const getCategoryPanelAPI = () => {
  return http<categoryPaanelItem[]>({
    url: '/home/category/mutli',
    method: "GET"
  })
}

// 获取热门推荐数据
export const getHotPanelAPI = () => {
  return http<HotPanelItem[]>({
    url: "/home/hot/mutli",
    method: "GET"
  })
}

// 获取猜你喜欢数据
export const getXtxGuessAPI = (data ?: PagePargram) => {
  // 将GuessItem传入泛型PageResult<T>
  return http<PageResult<GuessItem>>({
    url: '/home/goods/guessLike',
    method: "GET",
    data
  })
}
